﻿using QFramework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

namespace ProjectSurvivor
{
    public class SaveSystem:AbstractSystem
    {
          
        public void Save() { }


        public void Load() { }

        public void SaveBool(string key,bool value) { 
        
        PlayerPrefs.SetInt(key,value ? 1 : 0);
        
        }

        public bool LoadBool(string key,bool defalutValue = false)
        {
            return PlayerPrefs.GetInt(key, defalutValue ? 1 : 0) == 1;
        }

        public void SaveInt(string key, int value)
        {

            PlayerPrefs.SetInt(key, value);

        }

        public int LoadInt(string key, int defalutValue = 0)
        {
            return PlayerPrefs.GetInt(key, defalutValue);
        }

        public void SaveString(string key, string value)
        {

            PlayerPrefs.SetString(key, value);

        }

        public string LoadString(string key, string defalutValue = default)
        {
            return PlayerPrefs.GetString(key, defalutValue);
        }

        protected override void OnInit()
        {
        }
    }
}
